-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Heartbeat] Fix broken invocation of synth package #26228
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
@@ -30,7 +30,7 @@ const debugSelector = "synthexec" | |||
func SuiteJob(ctx context.Context, suitePath string, params common.MapStr, extraArgs ...string) (jobs.Job, error) { | |||
// Run the command in the given suitePath, use '.' as the first arg since the command runs | |||
// in the correct dir | |||
newCmd, err := suiteCommandFactory(suitePath, append(extraArgs, ".")...) | |||
newCmd, err := suiteCommandFactory(suitePath, append([]string{suitePath}, extraArgs...)...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's intentional and fixes the bug.
Sorry, will add tests soon, I shouldn't have flagged you for review this early. The bug was we'd invoke with --capabilities foo bar .
where .
indicated the current directory. Synthetics interpreted .
as a capability, not the location of the test. So, we needed to ensure that the suite path was the first arg. While I was at it I switched from .
to suitePath
which was more readable and makes copy/pasting the command easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally, no worries. Yes this is the issue with varidiac args in the commander
library we are using - This is one of the reason why I was suggesting to add a test here - #25808 (comment)
Glad we caught the error. If you are curios - https://github.com/tj/commander.js/blob/master/docs/options-taking-varying-arguments.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -42,6 +42,10 @@ func parseVersion(version string) string { | |||
} | |||
|
|||
func validateVersion(expected string, current string) error { | |||
if strings.HasPrefix(current, "file://") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to move this behind a flag? Just a thought though, what if users runs a custom locally modified synth version?
But I am also thinking, if they are using the flag, then we are in the same boat. your call.
Pinging @elastic/uptime (Team:Uptime) |
@Mergifyio backport 7.x |
Fixes invocation of synthetics broken in #26188 Additionally, for dev purposes, this lets accepts a synthetics version of file:/// as valid to help with debugging development versions of the synthetics agent. Never released, so no changelog needed Still just sticking with unit tests here since testing more deeply with synthetics (esp. master where this is a problem) is a larger problem than we're equipped to handle ATM. (cherry picked from commit ad7c19f) # Conflicts: # x-pack/heartbeat/monitors/browser/source/validatepackage.go # x-pack/heartbeat/monitors/browser/source/validatepackage_test.go
Command
|
* master: (26 commits) Report total and free CPU for vSphere virtual machines (elastic#26167) [filebeat] Add preserve_original_event option to o365audit input (elastic#26273) Change xml processor names in script processor to match convention (elastic#26263) [Oracle] Fixing default values for paths in config template (elastic#26276) Add more ECS fields to logs (elastic#25998) [Heartbeat] Fix broken invocation of synth package (elastic#26228) rename sqs file name (elastic#26227) Populate the agent action result if there is no matching action handlers (elastic#26152) Add ISO8601 as supported timestamp type (elastic#25564) Move Filebeat azure module to GA (elastic#26168) Filebeat azure module pipeline fixes and changes (elastic#26148) libbeat: monitor version (elastic#26214) Add new parser to filestream input: container (elastic#26115) [Metricbeat] Add state_statefulset replicas.ready (elastic#26088) Disable test processors system test for windows 10 (elastic#26216) Fix startup with failing configuration (elastic#26126) Remove 32 bits version of Elastic Agent. (elastic#25708) Chane fleetmode detection to ony use management.enabled (elastic#26180) Make `filestream` input GA (elastic#26127) libbeat/idxmgmt/ilm: fix alias creation (elastic#26146) ...
…26250) * [Heartbeat] Fix broken invocation of synth package (#26228) Fixes invocation of synthetics broken in #26188 Additionally, for dev purposes, this lets accepts a synthetics version of file:/// as valid to help with debugging development versions of the synthetics agent. Never released, so no changelog needed Still just sticking with unit tests here since testing more deeply with synthetics (esp. master where this is a problem) is a larger problem than we're equipped to handle ATM. (cherry picked from commit ad7c19f) # Conflicts: # x-pack/heartbeat/monitors/browser/source/validatepackage.go # x-pack/heartbeat/monitors/browser/source/validatepackage_test.go * Fix license * Fix notice Co-authored-by: Andrew Cholakian <andrew@andrewvc.com>
…26250) * [Heartbeat] Fix broken invocation of synth package (#26228) Fixes invocation of synthetics broken in #26188 Additionally, for dev purposes, this lets accepts a synthetics version of file:/// as valid to help with debugging development versions of the synthetics agent. Never released, so no changelog needed Still just sticking with unit tests here since testing more deeply with synthetics (esp. master where this is a problem) is a larger problem than we're equipped to handle ATM. (cherry picked from commit ad7c19f) # Conflicts: # x-pack/heartbeat/monitors/browser/source/validatepackage.go # x-pack/heartbeat/monitors/browser/source/validatepackage_test.go * Fix license * Fix notice Co-authored-by: Andrew Cholakian <andrew@andrewvc.com> (cherry picked from commit 5f49358)
…26250) (#27083) * [Heartbeat] Fix broken invocation of synth package (#26228) Fixes invocation of synthetics broken in #26188 Additionally, for dev purposes, this lets accepts a synthetics version of file:/// as valid to help with debugging development versions of the synthetics agent. Never released, so no changelog needed Still just sticking with unit tests here since testing more deeply with synthetics (esp. master where this is a problem) is a larger problem than we're equipped to handle ATM. (cherry picked from commit ad7c19f) # Conflicts: # x-pack/heartbeat/monitors/browser/source/validatepackage.go # x-pack/heartbeat/monitors/browser/source/validatepackage_test.go * Fix license * Fix notice Co-authored-by: Andrew Cholakian <andrew@andrewvc.com> (cherry picked from commit 5f49358) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fixes invocation of synthetics broken in #26188
Additionally, for dev purposes, this lets accepts a synthetics version of
file:///
as valid to help with debugging development versions of the synthetics agent.Never released, so no changelog needed
Still just sticking with unit tests here since testing more deeply with synthetics (esp. master where this is a problem) is a larger problem than we're equipped to handle ATM.
Checklist
- [ ] I have made corresponding changes to the documentation- [ ] I have made corresponding change to the default configuration files- [ ] I have added an entry inCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
Can be done with
file://
deps in package.json used to run the latest synthetics master branch